import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Kind from '../views/Kind.vue'
import Cart from '../views/Cart.vue'
import My from '../views/My.vue'
import Error from '../views/Error.vue'
import Login from '../views/Login.vue'
import Register from '../views/register/Register.vue'
import Reg1 from '../views/register/Reg1.vue'
import Reg2 from '../views/register/Reg2.vue'
import Reg3 from '../views/register/Reg3.vue'
import Detail from '../views/Detail.vue'
import Footer from '../components/Footer/Footer.vue'
import Homecaty from '../views/Homecaty.vue'
import ChangePassword from '../views/ChangePassword.vue'
import List from '../views/List.vue'
import MyOrder from "../views/MyOrder.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: '/home', // 重新定向到/home的酷游
  },
  {
    path: '/home',
    name: 'Home',
    components: {
      default: Home,
      Footer
    }
  },
  {
    path: '/kind',
    name: 'Kind',
    components: {
      default: Kind,
      Footer
    }
  },
  {
    path: '/cart',
    name: 'Cart',
    components: {
      default: Cart,
      Footer
    }
  },
  {
    path: '/my',
    name: 'My',
    components: {
      default: My,
      Footer
    }
  },
  {
    path: '/login',
    name: "Login",
    component: Login
  },
  {
    path: '/homecaty',
    name: 'Homecaty',
    component: Homecaty
  },
  {
    path: '/changePassword',
    name: 'ChangePassword',
    component: ChangePassword
  },
  {
    path: '/list',
    name: 'List',
    component: List
  },
  {
    path: '/myOrder',
    name: 'MyOrder',
    component: MyOrder
  },
  {
    path: '/register',
    name: "Register",
    component: Register,
    redirect: 'register/one',
    children: [
      {
        path: "/register/one",
        name:"Reg1",
        component:Reg1
      },
      {
        path: "/register/two",
        name:"Reg2",
        component:Reg2
      },
      {
        path: "/register/three",
        name:"Reg3",
        component:Reg3
      }
    ]
  },
  {
    path: '/detail/:proid',
    name: 'Detail',
    component: Detail
  },
  
  {
    path: '*', // 不是路由规则中的路由
    name: 'Error',
    component: Error
  },
 
]

const router = new VueRouter({
  routes
})

export default router
